package mornd.test2;

import org.springframework.beans.factory.DisposableBean;

import javax.annotation.PreDestroy;

/**
 * @author: mornd
 * @dateTime: 2023/5/5 - 15:59
 *
 * 执行顺序：destroy1 -> destroy -> destroy3
 */
public class Bean2 implements DisposableBean {
    @PreDestroy
    public void destroy1() {
        System.out.println("destroy1执行");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("destroy执行");
    }

    public void destroy3() {
        System.out.println("destroy3执行");
    }
}
